import type { IResult } from "@/types/common";
import { getAxios, commonAxiosJson } from "@/utils/request.ts";
/* 基本配置地址 */
const url = "/admin/system/config";

/* 获取基本配置 */
export const getConfigBasicInfo = <T>(): Promise<IResult<T>> => {
  return getAxios<T>(url + "/basic");
};
/* 修改基本配置 */
export const putConfigBasicInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/basic", params, "PUT");
};
/* 获取msg配置 */
export const getConfigMsgInfo = <T>(): Promise<IResult<T>> => {
  return getAxios<T>(url + "/msg");
};
/* 修改msg配置 */
export const putConfigMsgInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/msg", params, "PUT");
};
